package com.wuliang.generate.common.core.annotation;

import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.core.annotation.AliasFor;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author create by WuLiang in 2020年5月8日
 */
@Inherited
@EntityScan
@Documented
@RefreshScope
//@EnableJpaAuditing
@EnableSwaggerConfig
@SpringBootApplication
@EnableDiscoveryClient
//@EnableJpaRepositories
@Target(ElementType.TYPE)
@EnableTransactionManagement
@Retention(RetentionPolicy.RUNTIME)
@EnableFeignClients({ "com.wuliang.generate.client" })
public @interface WLApplication {

    @AliasFor(annotation = Import.class, value = "value")
    Class<?>[] anotherRegistryConfigs() default {};

    @AliasFor(annotation = EntityScan.class, value = "basePackages")
    String[] anotherEntityPackages() default { "" };

    @AliasFor(annotation = ComponentScan.class, value = "value")
    String[] anotherScanPackages() default { "" };

//    @AliasFor(annotation = EnableJpaRepositories.class, value = "basePackages")
//    String[] repositoryPackage() default { "" };

    @AliasFor(annotation = SpringBootApplication.class, value = "exclude")
    Class<?>[] exclude() default {};

}
